/*
 * UploadHelper.cpp
 *
 *  Created on: 2017年11月8日
 *      Author: zhengboyuan
 */

#include "UploadHelper.h"
#include "TStringCast.h"
#include "Path.h"

UploadHelper::UploadHelper()
{
}

UploadHelper::~UploadHelper()
{
}

StringMap UploadHelper::makeFormData(const char* deviceNo, const char* itemLogId,
	int fileType, const char* startTime, const char* endTime)
{
	StringMap header;

	header["deviceNo"] = deviceNo;
	header["itemLogId"] = itemLogId;
	header["fileType"] = comn::StringCast::toString(fileType);
	header["startTime"] = startTime;
	header["endTime"] = endTime;

	return header;
}

FileUpload UploadHelper::makeFileUpload(const char* filepath)
{
	FileUpload fileUpload;
	fileUpload.filepath = filepath;
	fileUpload.name = "file";// comn::Path::getFileName(fileUpload.filepath);
	fileUpload.mime = "application/octet-stream";
	return fileUpload;
}